package com.example.qiehuanactivity;

import java.util.ArrayList;
import java.util.List;

import com.example.android.navigationdrawerexample.R;


import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.LinearLayout;

public class SB2_DownView extends Activity{

	LinearLayout linearLayout_Sb2_down1 = null;
	LinearLayout linearLayout_Sb2_down2 = null;
	LinearLayout linearLayout_Sb2_down3 = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.workout_statistic_sb2_down);
		List<Integer> list1 = new ArrayList<Integer>();
		int listnum1[] = { 20,  55, 20, 40, 40, 45, 55, 20, 10, 45,
				58, 60, 71, 50, 60, 65, 40, 12, 45, 70, 55, 55, 80, 70, 30, 45, 30};
		for (int i = 0; i < 27; i++) {
			list1.add(listnum1[i]);
		}
		List<String> name_1 = new ArrayList<String>();
		name_1.add("high");
		name_1.add("7-9");
		name_1.add("mid");
		name_1.add("3-6");
		name_1.add("low");
		name_1.add("0-2");
		name_1.add("Time");

		List<Integer> list_number = new ArrayList<Integer>();
		list_number.add(482);
		list_number.add(27);
		list_number.add(7);
		
		DisplayMetrics dm = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(dm);
		int screenWidth = dm.widthPixels;
		int screenHeigh = dm.heightPixels;
		linearLayout_Sb2_down1 = (LinearLayout)findViewById(R.id.linearLayout_Sb3_down1);
		linearLayout_Sb2_down1.addView(new RedBackBar2(SB2_DownView.this, screenWidth, screenHeigh, 0, list1, name_1 ,list_number));
		List<Integer> list2 = new ArrayList<Integer>();
		
		int listnum2[] = {20,20,20,20,60,60,80,60,60,40,60,80,100,100};
    	for(int i = 0; i < 14; i++) {
    		list2.add(listnum2[i]);
    	}
    	List<String> name_2 = new ArrayList<String>();
		name_2.add("8");
		name_2.add("7");
		name_2.add("6");
		name_2.add("5");
		name_2.add("4");
		name_2.add("Time");
    	linearLayout_Sb2_down2 = (LinearLayout)findViewById(R.id.linearLayout_Sb3_down2);
		linearLayout_Sb2_down2.addView(new SingleLineView2(SB2_DownView.this, screenWidth, screenHeigh,0,list2,list2,name_2, list_number));
		List<Integer> list3 = new ArrayList<Integer>();
		int listnum3[] = {20,20,42,38,48,42,30,30,42,39,39,83,100,43,70,60,75,60,40,19,19,46,57,46,46,19,19};
		for (int i = 0; i < 27; i++) {
			list3.add(listnum3[i]);
		}
		List<String> name_3 = new ArrayList<String>();
		name_3.add("6");
		name_3.add("5");
		name_3.add("4");
		name_3.add("3");
		name_3.add("2");
		name_3.add("Time");
		linearLayout_Sb2_down3 = (LinearLayout)findViewById(R.id.linearLayout_Sb3_down3);
		linearLayout_Sb2_down3.addView(new RedLineBarView(SB2_DownView.this, screenWidth, screenHeigh, 0, list3, name_3 ,list_number));
		
	}
	
	
}
